{extend name='admin@main'}

{block name="button"}

{if auth("get_user")}
<a class="layui-btn layui-btn-sm layui-btn-normal" data-confirm="确定要同步员工列表信息吗？" data-value="id#{key}" data-action="{:url('get_user')}">同步员工列表信息</a>
{/if}

{/block}

{block name="content"}
<div class="think-box-shadow">
    {include file='ding_user/index_search'}
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='text-left nowrap'>userid</th>
            <th class='text-center nowrap'>员工名称</th>
            <th class='text-center nowrap'>头像</th>
            <th class='text-left nowrap'>手机号码</th>
            <th class='text-center nowrap'>职位</th>
            <th class='text-left nowrap'>员工邮箱</th>
            <!-- <th class='text-left nowrap'>所属部门</th> -->
            <th class='text-center nowrap'>性别</th>
            <th class='text-center nowrap'>激活状态</th>
            <th class='text-left nowrap'></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='text-left nowrap'>{$vo.userid|default=''}</td>
            <td class='text-center nowrap'>{$vo.name|default=''}</td>
            <td class='text-center nowrap'>
                <img data-tips-image="{$vo.avatar|default=''}" src="{$vo.avatar|default=''}" alt="" width="40px">
            </td>
            <td class='text-left nowrap'>{$vo.mobile|default=''}</td>
            <td class='text-center nowrap'>{$vo.position|default=''}</td>
            <td class='text-left nowrap'>{$vo.email|default=''}</td>
            <!-- <td class='text-left nowrap'>
                {foreach $vo.department as $v}
                <span class="layui-badge layui-bg-green">{$v}</span>
                {/foreach}
            </td> -->
            <td class='text-center nowrap'>
                {if $vo.gender == 0}
                <span class="color-green">未定义</span>
                {elseif $vo.gender == 1}
                <span class="color-red">男性</span>
                {elseif $vo.gender == 2}
                <span class="color-red">女性</span>
                {/if}
            </td>
            <td class='text-center nowrap'>
                {if $vo.status == 1}
                <span class="color-green">已激活</span>
                {elseif $vo.status == 2}
                <span class="color-red">已禁用</span>
                {elseif $vo.status == 4}
                <span class="color-red">未激活</span>
                {elseif $vo.status == 5}
                <span class="color-red">退出企业</span>
                {/if}
            </td>
            <td class='text-left nowrap'>
                {if auth("edit")}
                <a class="layui-btn layui-btn-sm" data-title="考勤记录" data-open='{:url("getcheckindata")}?userid={$vo.userid}&back=1'>近30天考勤记录</a>
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>

{/block}
